<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddColumnsToElOrderItemTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('el_order_item', function (Blueprint $table) {
            $table->integer('supplier_id')->default(1)->after('total'); //供应商ID
            $table->integer('shipping_id')->default(0)->after('total'); //发货ID
            $table->tinyInteger('is_send')->default(0)->after('total'); //是否一发货
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('el_order_item', function (Blueprint $table) {
            $table->dropColumn(['supplier_id','shipping_id', 'is_send']);
        });
    }
}
